set ctrl_pressed and shift_pressed according to the current event state
authorKristian Rietveld <kris@gtk.org>
Tue, 21 Oct 2003 20:19:14 +0000 (20:19 +0000)
committerKristian Rietveld <kristian@src.gnome.org>
Tue, 21 Oct 2003 20:19:14 +0000 (20:19 +0000)
Tue Oct 21 22:07:12 2003  Kristian Rietveld  <kris@gtk.org>

* gtk/gtktreeview.c (gtk_tree_view_real_move_cursor): set
ctrl_pressed and shift_pressed according to the current event
state (if there is one). (Fixes #125063, reported by Sebastien Bacher).

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktreeview.c

index 9974cde183298dc6bd000fa9b2445495319c44c1..f89e35fe568a7e1cff7b4c8d0817b46dbb2b0eb3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Oct 21 22:07:12 2003  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_move_cursor): set
+       ctrl_pressed and shift_pressed according to the current event
+       state (if there is one). (Fixes #125063, reported by Sebastien Bacher).
+
 Mon Oct 20 23:24:27 2003  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtkentry.c (gtk_entry_key_press): remove the completion
index 9974cde183298dc6bd000fa9b2445495319c44c1..f89e35fe568a7e1cff7b4c8d0817b46dbb2b0eb3 100644 (file)
@@ -1,3 +1,9 @@
+Tue Oct 21 22:07:12 2003  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_move_cursor): set
+       ctrl_pressed and shift_pressed according to the current event
+       state (if there is one). (Fixes #125063, reported by Sebastien Bacher).
+
 Mon Oct 20 23:24:27 2003  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtkentry.c (gtk_entry_key_press): remove the completion
index 9974cde183298dc6bd000fa9b2445495319c44c1..f89e35fe568a7e1cff7b4c8d0817b46dbb2b0eb3 100644 (file)
@@ -1,3 +1,9 @@
+Tue Oct 21 22:07:12 2003  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_move_cursor): set
+       ctrl_pressed and shift_pressed according to the current event
+       state (if there is one). (Fixes #125063, reported by Sebastien Bacher).
+
 Mon Oct 20 23:24:27 2003  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtkentry.c (gtk_entry_key_press): remove the completion
index 9974cde183298dc6bd000fa9b2445495319c44c1..f89e35fe568a7e1cff7b4c8d0817b46dbb2b0eb3 100644 (file)
@@ -1,3 +1,9 @@
+Tue Oct 21 22:07:12 2003  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_move_cursor): set
+       ctrl_pressed and shift_pressed according to the current event
+       state (if there is one). (Fixes #125063, reported by Sebastien Bacher).
+
 Mon Oct 20 23:24:27 2003  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtkentry.c (gtk_entry_key_press): remove the completion
index 9974cde183298dc6bd000fa9b2445495319c44c1..f89e35fe568a7e1cff7b4c8d0817b46dbb2b0eb3 100644 (file)
@@ -1,3 +1,9 @@
+Tue Oct 21 22:07:12 2003  Kristian Rietveld  <kris@gtk.org>
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_move_cursor): set
+       ctrl_pressed and shift_pressed according to the current event
+       state (if there is one). (Fixes #125063, reported by Sebastien Bacher).
+
 Mon Oct 20 23:24:27 2003  Kristian Rietveld  <kris@gtk.org>
 
        * gtk/gtkentry.c (gtk_entry_key_press): remove the completion
index 9bd611d0c44f14098dbcc919809405978ff779cf..f04ad6faa01ec7aac108f9bf0369a17083526f61 100644 (file)
@@ -6264,6 +6264,8 @@ gtk_tree_view_real_move_cursor (GtkTreeView       *tree_view,
                                GtkMovementStep    step,
                                gint               count)
 {
+  GdkModifierType state;
+
   g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE);
   g_return_val_if_fail (step == GTK_MOVEMENT_LOGICAL_POSITIONS ||
                        step == GTK_MOVEMENT_VISUAL_POSITIONS ||
@@ -6280,6 +6282,15 @@ gtk_tree_view_real_move_cursor (GtkTreeView       *tree_view,
   GTK_TREE_VIEW_SET_FLAG (tree_view, GTK_TREE_VIEW_DRAW_KEYFOCUS);
   gtk_widget_grab_focus (GTK_WIDGET (tree_view));
 
+  if (gtk_get_current_event_state (&state))
+    {
+      if ((state & GDK_CONTROL_MASK) == GDK_CONTROL_MASK)
+        tree_view->priv->ctrl_pressed = TRUE;
+      if ((state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK)
+        tree_view->priv->shift_pressed = TRUE;
+    }
+  /* else we assume not pressed */
+
   switch (step)
     {
       /* currently we make no distinction.  When we go bi-di, we need to */
@@ -6300,6 +6311,9 @@ gtk_tree_view_real_move_cursor (GtkTreeView       *tree_view,
       g_assert_not_reached ();
     }
 
+  tree_view->priv->ctrl_pressed = FALSE;
+  tree_view->priv->shift_pressed = FALSE;
+
   return TRUE;
 }